<script type="text/javascript">
	var http = false;

	if(navigator.appName == "Microsoft Internet Explorer") {
	http = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	http = new XMLHttpRequest();
	}




	function replace() {
	ray.ajax();
	http.open("GET", "test.txt", true);
	http.onreadystatechange=function() {
	if(http.readyState == 4) {
	document.getElementById('foo').innerHTML = http.responseText;
	}
	}
	http.send(null);
	}



	var ray={
	ajax:function(st)
	{
	this.show('load');
	},
	show:function(el)
	{
	this.getID(el).style.display='';
	},
	getID:function(el)
	{
	return document.getElementById(el);
	}
	}


</script>

<style type="text/css">
	#load{
	position:absolute;
	z-index:1;
	border:3px double #999;
	background:#f7f7f7;
	width:300px;
	height:300px;
	margin-top:-150px;
	margin-left:-150px;
	top:50%;
	left:50%;
	text-align:center;
	line-height:300px;
	font-family:"Trebuchet MS", verdana, arial,tahoma;
	font-size:18pt;
	}
</style>

<div id="load" style="display:none;">Loading... Please wait</div>

<p>
	<a href="javascript:replace()" >Replace Text</a>
</p>
hello world!!!



<div id="foo">
  Hello, world!
</div>